package com.zr.action;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.zr.model.Cuser;

public class MainAction extends ActionSupport implements ServletResponseAware,SessionAware{

	 private HttpServletResponse resp;
	 private  Map<String,Object> session; 
	@Override
	public void setServletResponse(HttpServletResponse arg0) {
		this.resp=arg0;
	}
	@Override
	public void setSession(Map<String, Object> arg0) {
		this.session=arg0;
	}
	
	public String main(){
		Cuser user=(Cuser)session.get("cuser");
		if(user==null){
		return "fail";
		}else{
			return "success";
		}
	}
	
    
}
